package com.huaxin.hxmoduleworkorder.common.validator;

import com.huaxin.hxmoduleworkorder.common.annotation.validation.ValidMaintenanceOrderElectricianTaskOperation;
import com.huaxin.hxmoduleworkorder.common.enums.MaintenanceOrderElectricianTaskOperation;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class MaintenanceOrderElectricianTaskOperationValidator implements ConstraintValidator<ValidMaintenanceOrderElectricianTaskOperation, String> {
    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return value == null || MaintenanceOrderElectricianTaskOperation.isValid(value);
    }
}
